import xhr from './xhr/';

/**
 * 对应后端涉及到用户认证的 API
 */
class MineService {
  /**
   * @param  {Object} userData
   * @return {Promise}
   */
  //获取个人信息
  getInformations(callBack){
     return xhr({
      url: '/api/user/contactInfoQuery',
      body: {},
      mock:true,
      prevShow:callBack
    });
  }

  //获取机构详情信息
  orgSeqInfoQuery(orgId){
    return xhr({
      url: '/api/user/orgSeqInfoQuery',
      body: {
        orgId:orgId
      },
      mock:true
    });

  }

  changePhone(phoneNum,CodeNum) {
    return xhr({
      url: '/api/user/contactInfoModify',
      body: {
        fsnCode:'01',
        param:phoneNum,
        checkCode:CodeNum,
        uuid:localStorage.getItem('uuid')
      }
    });
  }

  changeEmail(emailNum) {
    return xhr({
      url: '/api/user/contactInfoModify',
      body: {
        fsnCode:'02',
        param:emailNum
      }
    });
  }

  //版本更新接口
  compareVersions(type,version){
    return xhr({
      url:'/api/user/compareVersions',
      body: {
        type:type,
        version:version
      }
    })
  }
}

// 实例化后再导出
export default new MineService();
